<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="EditPage.ascx.cs" Inherits="FreeLancer.HRB.WebApp.UserControls.EditPage" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v8.1, Version=8.1.1.0, Culture=neutral, PublicKeyToken=49d90c14d24271b5"
  Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dxe" %>
<%@ Register Assembly="DevExpress.Web.ASPxHtmlEditor.v8.1, Version=8.1.1.0, Culture=neutral, PublicKeyToken=49d90c14d24271b5"
  Namespace="DevExpress.Web.ASPxHtmlEditor" TagPrefix="dxhe" %>
<%@ Register Assembly="DevExpress.Web.v8.1, Version=8.1.1.0, Culture=neutral, PublicKeyToken=49d90c14d24271b5"
  Namespace="DevExpress.Web.ASPxUploadControl" TagPrefix="dxuc" %>
<div>
  <div style="margin-bottom: 10px;">
    <span><%=Resources.labels.title %></span>
    <asp:TextBox runat="server" ID="txtTitle" Width="300px"></asp:TextBox>
    <asp:RequiredFieldValidator ID="RequiredFieldValidator" runat="server" 
      ControlToValidate="txtTitle" Display="Dynamic" ErrorMessage="<%$ Resources:labels, titleReqMsg %>" />
      &nbsp;&nbsp;&nbsp;
    <span><%=Resources.labels.language %></span>
    <asp:DropDownList runat="server" ID="cboLanguage" Width="100px" 
      OnSelectedIndexChanged="cboLanguage_SelectedIndexChanged" AutoPostBack="true">
    </asp:DropDownList>
      &nbsp;&nbsp;&nbsp;
    <span style="color:RoyalBlue"><%=Resources.labels.updateAt %>&nbsp;<asp:Label runat="server" ID="lblTime"></asp:Label></span>
  </div>
  <div id="Editor" style="margin-bottom: 10px;">
    <dxhe:ASPxHtmlEditor ID="ASPxHtmlEditor" runat="server" Width="1000px" Height="500px" 
      ActiveView="Preview" 
      SettingsText-DesignViewTab="<%$ Resources:labels, tabDesign %>"
      SettingsText-PreviewTab="<%$ Resources:labels, tabPreview %>">
      <SettingsImageUpload UploadImageFolder="/Images/PageImages/">
          <ValidationSettings AllowedContentTypes="image/jpeg,image/pjpeg,image/gif,image/png,image/x-png"
            NotAllowedContentTypeErrorText="<%$ Resources:labels, notAllowedContentTypeErrorText %>" 
            FileDoesNotExistErrorText="<%$ Resources:labels, fileDoesNotExistErrorText %>"
            MaxFileSize="1000000"
            MaxFileSizeErrorText="<%$ Resources:labels, maxFileSizeErrorText %>">
          </ValidationSettings>
        </SettingsImageUpload>
    </dxhe:ASPxHtmlEditor>
  </div>
  <table>
    <tr>
        <td>
          <span><%=Resources.labels.attachedFile %></span>
        </td>
        <td>
          <asp:CheckBox ID="chkUploadedFile" runat="server" Visible="false"/>
          <asp:HyperLink ID="linkUploadedFile" runat="server" Visible="false"></asp:HyperLink>
          <dxuc:ASPxUploadControl ID="ASPxUploadControlFile" runat="server"
            OnFileUploadComplete="ASPxUploadControlFile_FileUploadComplete" 
            ClientInstanceName="ciEditPost_ASPxUploadControlFile" Width="50px">
            <ValidationSettings
              NotAllowedContentTypeErrorText="<%$ Resources:labels, notAllowedContentTypeErrorText %>" 
              FileDoesNotExistErrorText="<%$ Resources:labels, fileDoesNotExistErrorText %>"
              MaxFileSize="1000000"
              MaxFileSizeErrorText="<%$ Resources:labels, maxFileSizeErrorText %>">
            </ValidationSettings>
          </dxuc:ASPxUploadControl>
        </td>
      </tr>
  </table>
  <div style="text-align:right">
    <asp:Button runat="server" ID="btnSave" Text="<%$ Resources:labels, cmdUpdate %>" OnClick="btnSave_Click"/>
  </div>
  <div style="text-align:right; color:Red; margin-top: 10px;">
    <asp:Label runat="server" ID="lblErrorUpdateFailed" Visible="false"
      Text="<%$ Resources:labels, infoUpdateFailed %>"></asp:Label>
    <asp:Label runat="server" ID="lblErrorLoadFailed" Visible="false"
      Text="<%$ Resources:labels, infoLoadFailed %>"></asp:Label>
  </div>
  <br />
</div>